//模板类中有模板类和模板函数
#include <iostream>
using namespace std;
template<class T1,class T2>
class myclass1{
public:
    T1 m_x;
    T2 m_y;
    myclass1(T1 x,T2 y):m_x(x),m_y(y){
        cout<<"myclass1的构造函数调用"<<endl;
    }
    template<class T3>
    void show_template(T3& x);
    void show(){
        cout<<"m_x="<<m_x<<" m_y="<<m_y<<endl;
    }
    template<class T>
    class myclass2{
    public:
        T m_a;
        T1 m_b;
        myclass2(T a="漳卅你",T1 b="za"):m_a(a),m_b(b){
            cout<<"myclass的构造函数"<<endl;
        }
    };
    myclass2<string> a;
};
template<class T1,class T2>
template<class T3>
void myclass1<T1,T2>::show_template(T3& x)
{
    cout<<"通过show_template()调用show"<<endl;
    x.show();
}
int main()
{
    myclass1<string,int> a("张三",10);
    a.show_template(a);
    return 0;
}